<template>
  <div>这是子组件</div>
  <div>{{money}}</div>
  <button @click="btn">花掉一百</button>
</template>

<script>

export default {
  props: {
    money: {
      type: Number,
      default: 0,
    },
  },
  emits:['huaqian'],
  setup(props, { emit }) {
    console.log(props.money);
    const btn = ()=>{
        emit('huaqian',100)
    }
    
    return { btn };
  },
};
</script>

<style>
</style>